package proxy

type Subject interface {
	Do() string
}

type RealSubject struct{}

func (rs *RealSubject) Do() string {
	return "realsubject do"
}

type ProxySubject struct {
	RealSubject
	dataRemain int
}

func (p *ProxySubject) Do() string {
	if p.dataRemain > 0 {
		return p.RealSubject.Do()
	}
	return "data is not enough"
}
